package com.chinaunicom.circularref;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2021/11/25 15:47
 * Description:
 */
public class CircularMain {

	public static void main(String[] args) {
		try {

			ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans-circular.xml");

			// 获取 bean 时可以指定参数
			TestA testA = (TestA) applicationContext.getBean("testA");
			testA.showMsg();


		} catch (Exception e) {
			Throwable cause = e.getCause().getCause().getCause();
			System.out.println("------ " + cause);
			e.printStackTrace();
		}
	}
}
